package dao.impl.jpa;

import java.util.List;

import dao.ReserveringDAO;
import domain.Reservering;

public class ReserveringDAOImpl extends BasePersistence implements
		ReserveringDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Reservering> findByPlanningId(int planning_id) {
        open();
        List<Reservering> set = em.createNamedQuery("Reservering.findByPlanningId").setParameter("planning_id", planning_id).getResultList();
        close();
		return set;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Reservering> findAll() {
		open();
		List<Reservering> set = em.createNamedQuery("Reservering.findAll").getResultList();
        close();
		return set;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<Reservering> findByName(String naam) {
		open();
		List<Reservering> set = em.createNamedQuery("Reservering.findByName").setParameter("naam", naam).getResultList();
        close();
		return set;
	}
}
